package Common

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func SuccessResponse(c *gin.Context, code int, data interface{}) {
	c.JSON(http.StatusOK, ResData{
		Code: code,
		Msg:  "成功",
		Data: data,
	})
}

func ErrorResponse(c *gin.Context, code int, message interface{}) {
	c.JSON(http.StatusOK, ResData{
		Code: code,
		Msg:  message,
		Data: nil,
	})
}
